<template>
    <div>
        <table>
            <tbody>
                <tr>
                    <td>账号</td>
                    <td>
                        <input type="text" v-model="data.name">
                    </td>
                </tr>
                <tr>
                    <td>账号</td>
                    <td>
                        <input type="password" v-model="data.password">
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="button" value="登录" @click="login">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import axios from 'axios';

const login=()=>{
    axios.get("https://localhost:7025/api/Member/Login",{params:data.value}).then(res=>{
        if(res.data.id>0){
            alert("登录成功")
        }
        else{
            alert("登录失败")
        }
    })
}

const data=ref({
  "name": "",
  "password": ""
})
</script>

<style scoped>

</style>